home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_5.lha / 8_5 / gets.c < prev    next >
Text File  |  1993-08-08  |  384b  |  19 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / read a string up to a newline, discarding the newline
  6. include <limits.h>
  7. har *gets(char *buf)
  8.  
  9.    if ((stdin->mode == input) &&
  10. stdin->in->get(buf, INT_MAX))
  11.     {
  12.     char c;
  13.     stdin->in->get(c);
  14.     return buf;
  15.     }
  16.  
  17.    return NULL;
  18.  
  19.